
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
  <a class="navbar-brand" href="{{ url_for('public.home') }}">
     Chaos Genius 
  </a>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
    aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>

  <div class="collapse navbar-collapse" id="navbarSupportedContent">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item active">
        <a class="nav-link" href="{{ url_for('public.home') }}">Home
          <span class="sr-only">(current)</span>
        </a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="{{ url_for('public.home') }}">About</a>
      </li>
    </ul>
    {% if current_user and current_user.is_authenticated %}
    <ul class="navbar-nav my-auto">
      <li class="nav-item active">
        <a class="nav-link" href="{{ url_for('user.members') }}">Logged in as {{ current_user.username }}</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="{{ url_for('public.logout') }}">
          <i class="fa fa-sign-out-alt"></i>
        </a>
      </li>
    </ul>
    {% elif form %}
    <form class="form-inline" id="loginForm" method="POST" action="{{ url_for('public.home') }}" role="login">
      <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
      <div class="input-group mb-2 mr-sm-2">
        {{ form.username(placeholder="Username", class_="form-control mr-sm-1 my-auto") }} {{ form.password(placeholder="Password",
        class_="form-control mr-sm-1 my-auto") }}
        <button class="btn btn-light btn-primary m-auto" type="submit">Login</button>
      </div>
    </form>
    <ul class="navbar-nav my-auto">
      <li class="nav-item">
        <a class="nav-link navbar-text" href="{{ url_for('public.register') }}">Create account</a>
      </li>
    </ul>
    {% endif %}
  </div><!-- /.navbar-collapse -->
</nav>

